//
//  VideoCell.m
//  LOL_JewelBox
//
//  Created by dllo on 15/4/21.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "VideoCell.h"

@implementation VideoCell

- (void)dealloc
{
    [_titleLabel release];
    [_numLabel release];
    [_durationLabel release];
    [_videoImageView release];
    [_MyView release];
    [_clickImageVIew release];
    [_timeImageView release];
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self.MyView = [UIView alloc]init];
        [self.contentView addSubview:self.MyView];
        [_MyView release];

        self.titleLabel = [[UILabel alloc]init];
        [self.MyView addSubview:self.titleLabel];
        self.titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:16];
        self.titleLabel.numberOfLines = 0;
        [_titleLabel release];

        self.numLabel = [[UILabel alloc]init];
        [self.MyView addSubview:self.numLabel];
        [_numLabel release];

        self.durationLabel = [[UILabel alloc]init];
        [self.MyView addSubview:self.durationLabel];
        [_durationLabel release];

        self.videoImageView = [[UIImageView alloc]init];
        [self.MyView addSubview:self.videoImageView];
        self.videoImageView.contentMode = UIViewContentModeScaleAspectFill;
        self.videoImageView.autoresizesSubviews = YES;
        self.videoImageView.clipsToBounds = YES;
        self.videoImageView.layer.cornerRadius = 5;
        [_videoImageView release];
        
        self.clickImageVIew = [[UIImageView alloc]init];
        [self.MyView addSubview:self.clickImageVIew];
        [_clickImageVIew release];
        
        self.timeImageView = [[UIImageView alloc]init];
        [self.MyView addSubview:self.timeImageView];
        [_timeImageView release];

    }
    return self;
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    self.MyView.frame = CGRectMake(0, 0, CONTENTWIDTH, CONTENTHEIGHT);
    self.videoImageView.frame = CGRectMake(CONTENTWIDTH *0.02667, CONTENTHEIGHT *0.05, CONTENTWIDTH *0.32, CONTENTHEIGHT *0.9);
    self.titleLabel.frame = CGRectMake(CONTENTWIDTH *0.37333 , CONTENTHEIGHT *0.05, CONTENTWIDTH *0.58667, CONTENTHEIGHT *0.6);
    self.timeImageView.frame = CGRectMake(CONTENTWIDTH *0.37333, CONTENTHEIGHT *0.6, CONTENTWIDTH *0.08, CONTENTHEIGHT *0.3);
    self.durationLabel.frame = CGRectMake(CONTENTWIDTH *0.48, CONTENTHEIGHT *0.6, CONTENTWIDTH *0.21333, CONTENTHEIGHT *0.3);
    self.clickImageVIew.frame = CGRectMake(CONTENTWIDTH *0.74667, CONTENTHEIGHT *0.6, CONTENTWIDTH *0.08, CONTENTHEIGHT *0.3);
    self.numLabel.frame = CGRectMake(CONTENTWIDTH *0.85333, CONTENTHEIGHT *0.6, CONTENTWIDTH *0.21333, CONTENTHEIGHT *0.3);
}

@end
